package com.zhiche.lisa.bms.dao.mapper.prepay;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zhiche.lisa.bms.dao.model.prepay.PrepayBill;
import com.zhiche.lisa.bms.pojo.vo.prepay.PrepayBillPertrolVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 预付账单 Mapper 接口
 * </p>
 *
 * @author zhangkun
 * @since 2018-09-20
 */
public interface PrepayBillMapper extends BaseMapper<PrepayBill> {
    /**
     * 无token查询预付账单
     *
     * @param ew
     * @return
     */
    List<PrepayBill> selectListNoTenant(@Param("ew") Wrapper<PrepayBill> ew);

    /**
     * 分页查询
     *
     * @param page
     * @param ew
     * @return
     */
    List<PrepayBillPertrolVO> selectPertrolOilPage(Page<PrepayBillPertrolVO> page,
                                                   @Param("ew") Wrapper<PrepayBill> ew);

    /**
     * 根据条件查询
     *
     * @param ew
     * @return
     */
    List<PrepayBillPertrolVO> selectPertrolOilCondition(@Param("ew") Wrapper<PrepayBillPertrolVO> ew);

    /**
     * 如果正常发运, 更新慧运车未发运的数据
     *
     * @param orderCode
     */
    void updateHuiyuncheLoadStatusByOrderCode(@Param("orderCode") String orderCode);

    /**
     * 计算金额
     * @param param
     * @return
     */
    PrepayBill sumPrebillCashNoTenant(@Param("param") Map<String, Object> param);
}
